package xin.baizhiedu.controller;

import cn.hutool.json.JSONUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xin.baizhiedu.service.QgWorkScenceService;

import java.util.Map;

@RequestMapping("/development/v9/QgWorkScenceController")
@RestController()
public class QgWorkScenceController {

    @Autowired
    QgWorkScenceService qgWorkScenceService;

    /**
     * 物料（工单）流转跟踪
     * @return
     */
    @GetMapping("/workOrderFlow")
    public Map<String,Object> searchWorkOrderFlow() {
        return qgWorkScenceService.searchWorkOrderFlow();
    }

    /**
     * 作业中心分布图
     * @return
     */
    @GetMapping("/workCenter")
    public Map<String,Object> searchWorkCenter() {
        return qgWorkScenceService.searchWorkCenter();
    }

    /**
     * 在制工单完成情况
     *
     * @return
     */
    @GetMapping("/workOrderCompletion")
    public String searchWorkOrderCompletion() {
        return JSONUtil.toJsonStr(qgWorkScenceService.searchWorkOrderCompletion());
    }
}
